package com.LeeCode;

/**
 * 统计已测试设备
 */

public class Code2960 {
    public static void main(String[] args) {
        int[] nums = {0, 1, 2};
        System.out.println(new Code2960().countTestedDevices(nums));
    }

    public int countTestedDevices(int[] batteryPercentages) {
        int count = 0, n = batteryPercentages.length;
        for (int i = 0; i < n; i++) {
            if (batteryPercentages[i] - count > 0) {
                count++;
            }
        }
        return count;
    }
}
